from django.db import models


# Create your models here.
# 实体:  有自己的数据
class User(models.Model):
    username = models.CharField('用户名', max_length=24)
    password = models.CharField('密码', max_length=128)
    is_vip = models.BooleanField('是否会员', default=False)
    money = models.IntegerField('余额', default=0)
    books = models.ManyToManyField('books.Book')
    # books_user


class Book(models.Model):
    title = models.CharField('书名', max_length=24)
    desc = models.CharField('简介', max_length=256)
    price = models.IntegerField('价格', default=100)

    def __str__(self):
        return self.title

# 关系:
